<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Canvas画板</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    .canvas {
      width: 800px;
      height: 800px;
      margin: 50px auto;
    }
    #canvas {
      border: 1px solid #dfdfdf;
      border-radius: 10px;
    }
    .operate {
      width: 800px;
      margin: 30px auto;
      display: flex;
      align-items: center;
    }
    .item {
      width: 50%;
      text-align: center;
      display: inline-block;
    }
    .btn {
      width: 80px;
      border: 0;
      padding: 5px 10px;
      color: #ffffff;
      border-radius: 5px;
    }
    .download {
      background: #1AAD19;
    }
    .clear {
      background: #e60011;
    }
  </style>
  <script type="text/javascript" src="index.js"></script>
</head>
<body>
  <div class="canvas">
      <canvas id="canvas" width="800px" height="500px">当前浏览器不支持canvas</canvas>
      <div class="operate">
        <div class="item">
          <button id="download" class="btn download">
              下载
          </button>
        </div>
        <div class="item">
            <button id="clear" class="btn clear">
                清除
            </button>
        </div>
      </div>
  </div>
</body>
</html>